<?php

namespace App\Exceptions;

use Exception;
use Illuminate\Http\JsonResponse;

class ApiException extends Exception
{
    public function __construct(string $msg = '', int $code = -1)
    {
        parent::__construct($msg, $code);
    }

    public function render(): JsonResponse
    {
        return failCodeMessage($this->getCode(), $this->getMessage());
    }
}
